﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Autofac;
using Autofac.Builder;

namespace Owlpal.Core.Mvc
{
    public class OwlpalControllerFactory : DefaultControllerFactory
    {
        private readonly Container _container;

        public OwlpalControllerFactory(Container container)
        {
            this._container = container;
        }

        protected override IController GetControllerInstance(Type controllerType)
        {
            return _container.Resolve(controllerType) as IController;
        }
    }
}
